#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define vec vector<int>
#define y1 y_____hahahaha_____1

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48); return x * sgn;}

const int N = 4e6+10;
const int mod = 998244353;

int m,n;
ll ans;

ll qp(ll x,int t){ll res = 1;for(;t;t >>= 1,x = x * x % mod) if(t & 1) res = res * x % mod;return res;}

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; for(int i = 1;i <= n;i++) m += in;
	for(int i = (ans = 1);i <= m;i++) ans = ans * i % mod;
	ans = ans * qp(m - n + 1,mod-2) % mod; printf("%lld\n",ans);
	return 0;
}
